<?php

include_once 'controller/default.php';
include_once 'model/comment/process.php';
if (isset($_POST)) {
    $comment = new comment();
    if (isset($_POST["update"])) {
        $update = $comment->Update($_POST);
        if($_POST["question_id"] > 0){
            if ($update) {
                echo '<script>alert("Chấp nhận Comment Question thành công.")</script>';
                include 'view/comment/comment_question_manager.php';
            } else {
                echo '<script>alert("Chấp nhận Comment Question thất bại.")</script>';
                include 'view/comment/comment_question_update.php';
            }
        }
        if($_POST["page_id"] > 0){
            if ($update) {
                echo '<script>alert("Chấp nhận Comment Pages thành công.")</script>';
                include 'view/comment/comment_manager.php';
            } else {
                echo '<script>alert("Chấp nhận Comment Pages thất bại.")</script>';
                include 'view/comment/comment_update.php';
            }
        }
    }
}
?>
